add onModInitError. Fixes #2