Modified to catch NameNotFoundException