improve events, fix test