initial version of checkUser function