Fixes #4 - events not triggered properly