fixed a variable bug