Fixed error and added basic error handler

In the previous commit I accidentally deleted the use of the proxy. Also added a really basic error handling, where any javascript error shows the same message and cleans the page.