Fixes password reset function