fix bug causing window to not appear