Fixing incorrect shared secret query