Fix issue that exec closes the script and typo with $DIR