fixed sql syntax bug and add database