Fixed to support new database