fixed issue with the database (credit: pepepr08)