Plugin Endpoint: fixing a php error