still not working properly at every iteration; added login and host info, but freeing memory for those also a problem