bug fix vars not declared