Fixes bug in the update