Removed debug statements. Moved error message so it shows for IE and Chrome