added error handling support to binding