Added command looping in map script