added checkuser function definition