ensure return value for function returning double