Throws an error in JSLint and also in JSHint

So some small repair, but I haven't tested, if the function will do the same as before...