Modified to support local run