added attack detection