added exception handling to options