added error logging, fixed user identity check on edit