fix bug conversion double to int