Added check for output path