explain why this cast is needed.