fixed a dangling state