updated exception handling for struct input