Fixed a bug in the update_profile sql query