Fix "Invalid thread access" problem by using the Display class asyncronously.