Added method to check errors in <Profile>

created a new method checkProfileProperties() to check errors in
<Profile> property, instead of adding the code to checkerrors() method
to reduce the number of lines in it to make it meet the check style
standard.