fix a bug in userprofile function