Made the sqlbuilder actually build a query based on state and string in parameter