added exists method to node