create directories if needed.