check path validation and correct the output line position