fix a bug preventing correct account linking