Updated with better focus handling when adding new students.