resolve problems when change the background of the Reconnect button and add a new mechanism to throw alertbox from the thread.