fixed bugs on Database.h