Fixed problem with shelve files by using a temporary folder