fixed bug in evaluation func