fixed misspelling of opts variable returning undefined