added error catching for entering path.