add changeObjectToClass function