need to fix the err output