changed the check for user, now error is also catches