Variable calculation with propertyerror