fixed bug in --join option