Fixed window size changing bug