Added some functions to User Model.