calculation error bug fixed