fix database module and test