Added parse query method.