fix bug in freq. demo