fix undifeined variable $separator on build function