add criteria test

add criteria test
fixed some bugs