Fixed error in update