fix JSLint error for function ordering