fixing a bug in the profiles controller