SQL query escaped fix