fixed another problem in choosing a function with volatile-side-effect