display the right buttons at the right moment