fixed another bug in calc method