Fixed issue with unused err variable