moved alert click event handler to layout