Fix bug in update process