code clean up

freeing the connection each to prevent reaching the limit
removing delay
removing fflush