replace error param with extern