improve focus handling