Fix bug of toggling mode in preferences screen doesn't behave correctly