use let instead of before block