removed redundant undefined check. pass options into model