fix bug of missing vars