logging debug messages to error_log() for safety