fixing a bug in the profiles model