repaire some errors