added checkUser function