more error checking and formatting profile page