Fixed null pointer issue in profile