fix in case masterdir does not exist