Added check to prevent direct script access.