fix some bug & interactive input