Moved variable declaration in toggle

JSHint is much relaxed compared to jshint