improve MRI api compatbility