fixes #1 handle errors and also extends into ::on method + fixes to test.html script