fixed Fatal error: Cannot access self:: when no class scope is active