adding EnsureDirectory function that makes sure that the directory exists for a given file path
changing up the implementation of transactional save table