raii and build fix