fixing mysql error throwing, wrong variable name