check and create dirs