fixed bugs in the user controller