inserted some missing var statements