javascript out of index, up arrow still wonky