check if directory exists before creating