fixed bug where errors were being swallowed