fix the bug in sql commands