fix evaluate function