the button is not in right order, and not closed after click the button

I found the example 3.1, the button is not in right order, and not closed after click the button, so make a small fix