deactivate/reactivate buttons based on events