fix several terrible mistake