Added output folder creation check and error output