code clean up + make sure the object is actually saved