added exception code to wrong spot