state bugs fixed