when inserting a function checking that it has been inserted already