fix var not found bugs