modified the code for DLException, but need to arrange well