check type of node ref in map before operating aginst it