Fix bug about updating window information