bug fix in cast to double