Check if dir exists before creating