Added check to avoid specifying output folder twice.