Query conditions can take in arbitrary values, this can cause SQL errors. This PR fixes it
contact_type