quick fix to see if this fixes and issue where preferences were resaving and adjusting the SQL query to correctly select someone's ckey from the client table.