working on frequency button. wrapped js in document ready