Adding some more logic to the user profile and search pages