Reorganized code, fixed crash when app lost focus with button held down