Added loading button and dialog box