fixed __del__ object bug in databasemanager