Egypt was vulnerable to foreign invaders ?