fixed bug when options.debug is set but options is undefined