FIxed teh Double to Integer cast error