added hostname as parameter. Some fix