fixes SQL issues with password reset