fix broken log function