refixed the row replication (javascript)