remove config.h
fix error handling