cleaned up dial loop