fixed unbound variable
fixed building script