forgot to initialize options when when options is undefined
clean up
made args for window.open() configurable