better solution to jshint error