Added error handling for attendance.