edit bug fix by moving database.results_as_hash = false