Supports allowEmpty option