fixed issue with getFirstNode