added folder creation and relative error handling