Updated checkUser logic