THIS finally fixes the bug with not accessing app correctly from drawwindow.
Merge