check empty data in update(), otherwise it deletes content