fixed a bug in profile.d script