Fixing pairing functionality