checking dir exists before making