another and better approach for fixing display bug