typeos and script exit and better position of the path validating