remove assert and dyn cast