I fixed a tiny variable naming error. Now it works fine.