adds unit functions to trigger the events