added __freeze function