fix testcases
delete handle func
fix condition