Fixing result storage error