added customized eventhandling for vertices and edges