Added fix when we can not create the directory