added check hash to host list and also clean up code a bit