Add checking callback condition when finding index by node id