Added option to add custom callbacks for different kinds of events