Prevent fatal error when directory does not exist