updated functions in user controller