fix edit and remove errors when user is deleted