Step 3
updated handling of console errors