change query() to exec()