resolved bugs function database.py