just a quick fix

the wrong var was passed to the database query..