more test code and fixed partially working events