"version" param condition fixed

The “version” param was not being treated as optional. The condition
was wrong as it wasn’t verifying which version should it be checked
against: the parameter version or an existent “version” in the
localStorage.