search path from the end