fixed bug with timing of setting currentNode