fixed conflict with global variable updatecount