Added cleaning up when cached result is returned