fixing compilation errors
adding cleaning and initialization