fix bugs

use int instead char