Removed unused variables on exception catch and format code
Format code