Fix a bug with functions accross scenes