Add container validation before using it.