Modifications on database.py