extra error handling needs cleaning