Fixes a bug when executing a function inside the scene IIFE