Moved finalizing code into a finally clause
Changed trigger String to 'p>'