Added exception handling to quote