updated rehooking and locking