Fixed bug with updating