Added ability to close source program connection to the files if 3-rd parameter is present