fixed 'current scope has no parent' warning

This fixes the warning introduced by #75 by using a CACHE INTERNAL (global) variable instead of PARENT_SCOPE which is typically null.