Added code to handle when the frequency base field has no selectable options, which I believe was leading to an infinite loop.