Added path validation