Fixed bug, now checks if selection is a node