Bug fix catching js console errors