fixed undefined error when no options object given