fixing a small bug in restrict.