Allowing emptyText to be a function