add database support
bug fix