Solved bug with looking for wrong variable