fix button handling