Updated functions to correctly return user