added tests for returning upserted elements