fixed try/catch location and output