inputQuery function working