fix bug of database selection support, issue #4