fix serialize to query