added AllowEmpty option