Fix the objects cleanup order