fix problem on halt