fix bug, use correct variable