Another fix for error-handling