added code to validate new edge.