Try to fix error handling