Fix focus jumping bug