made js flash replace optional