fixes bug with updating