fix error on manual close, recompile