fix for type casting error involving double -> float conversion