added some new event handling for relations and attributes