added done() for throwing unhandled rejections or forwarding errors to a user defined onerror handler