didn't think "id" should be the id of the hidden variable. changed to call it resource-id
ob_start was muffling exceptions (this is a recent change). Changed code to catch exception, display then clean buffer, and then throw the exception.