updated query submission to handle multi-line query