function for user check