fixing bug calculating updates