Functionalized checkUsername and checkEmail