fixes edge case of empty tree searches failing