Check directories exist before trying to add them to the PATH