No longer crashes after switching modes, turns out I forgot to stop
the handler
Merge pull request #4 from brianlau/master

This fixes a bug