improve run docker function