Do not draw during window occlusion
Updated holding priorities
Fix potential crash