fix bug in var declaration handler