Add function to handle profile page