added handler to MainActivity for communicating with UI thread