changing double space to single in java script