Add error control. Reduce output messages(Most for debug).