bugfix: create missing directories, instead of failing with NPE