fix unreachable check bug
add additional tests