You shouldn't need to cast here, were you getting compile errors?