fixed null pointer setting for mkdir