fixed some bugs in evaluation