fix bug where if value wasn't string, query blew up