create necessary directories if they do not exist