Added exit wait and pwd