fix calling of sampling functions