program now disconnects after end