Fixed to work for new db fields