Fixed a bug with appwindow