fix bug in sql shell