fixing type casting for numbers