implemented storing of key files in Mongo and now using temporary files