fix variable name
better browser compatibility and fix bug with feature count