Fixes the leave state never happening right.