throws error if the frequency values ​​are not recorded