corrected profile validation and added test