fixed a bug with variable