catch events properly