add function for add instances