change scope of variables
fix scope of trycatch, fix log rethrow macro.