Fixed error: Double value cannot be converted to Int because the result would be greater than Int.max in 32-bit devices