Added input and output path validation