Remove unused function: error