Add isset() call to fix php error message