added more logic to profile page