added bad IP checking