Add else after if else to excecute UPDATE query.