fixed bug where search was returning the element in front of the desired node