Fixed using wrong variable names.