strip whitespace from queries