Changing os function so it actually caches correctly

and doesn't try to do assignment every time.