fixed query issue in profile controller