fix a bug in recently added display-changed method