Added custom events support