fix no-use-before-define lint warnings
Merge pull request #1161 from emkay/no-use-before-define-lint

fix no-use-before-define lint warnings