added handleResult structure