Fixed unbound variable error