added set_endpoint_dir() method