add dash code handle
tidy code