added option to create root folder if it doesn't exist