js ref wrong