removing .onAttach and previous potential fix for suppressing error

Well, it seems to me that `.onAttach` caused the trouble, which should be IMO removed. Please review, but seems to work.