Added some exception handling, still lot of uncaught errors