Fixed thread problems in MainActivity and BCSimulateThread