Fixes ERROR: Uncaught ReferenceError: current is not defined

Small change, I would occasionally get this error. The attached change fixes it.

I saw there was a test command in the package.json but didn't see a tests dir so am not sure if this will break anything, seems to work on my app though...