remove trigger before removing function