added checks for delete user