(2)If any of the persons upon whom a notice has been served under sub-section (1), appears in pursuance thereof before the Chief Officer and gives an undertaking to him that such person, shall, within a period specified by the Chief Officer, execute such works of improvement in relation to the building, as will, in the opinion of the Chief Officer render the building fit for human habitation until the Chief Officer on being satisfied that it has been rendered fit for that purpose, cancels the undertaking, the Chief Officer shall not make an order of demolition of the building.