fixed bug in sql query
black topic if host is down