make callback only if function passed