options can be a function