Fix focus and blur functionality