fix double to int casting