added apply event function