fix bug with console logging