Added some error handling. The plugin should be a little more stable now