modify functions checkUser and addUser