improve the path_write for adding the error notice