fix reusing variables