Fix bug in update_attempt