correct code so that the double.parse wouldn't throws an exception error