Fix submit query bug.