fixing options is undefined error