added dashes and if in js