replace checking for user name bye a more logic check for position