still unable to wrap results into global var or use function to retrieve results properly