fixed eval function