fix error catch, add application test, context test.