Enable buttons at the right time