parse double properly