fix bug related to button state when app is resumed