fixed js comparison of arrays