fix test error

It is learnt from #627
@xiangli-cmu @philips