Could you take out the alert in favor of a console.error? It makes it more difficult to test other things.