1. major bugfixes,
2. added error handler for #3