fixed problem in inference