Replaced console.error with public.debug