Added logic to return user data to view