fix js error if console is undefined [Closes #239]