setFrozen generic method