fixed a bug in evalsamplexvar()