added wait parameter when creating a container