fixed empty result object (assignment before callback)