[code] fix bugs