Fixed stupid spelling error
Fixed resetting the wrong variable