fixed bug in update