invalid indexing within JS closure ..