catch illegal state exception for invalid hosts (proper error handling needed)