fixed the restrict bug