fix eval function