Put update and remove inside of else statement