Fixed a bug when unpublishing external input