removed unused error variable