slightly simplied version of the @divemonkey patch as I didn't want to pesist to disk for #31 as it will add IO overhead which will rarley be needed (i.e. on server restart days)