hotfix bug with ordering of calculations