Fixed program terminating when display run in own thread