cleaned up path validation logic.