fixed dead-end issue