cb for creating function