SAM_Inference Bug fix