Fixed insert query and redid variable names.