Fix flashing issue as suggested by @lord