Fixed javascript causing missing last word