add missing err checking