clean up double firing of a function