Fixing logic error in profile