added an object add function