i have a keyless entry problem?

i have a 1998 cobra and the keyless entry module quit working causing the inside light to go out.i replaced the module with one that has the same fcc id number,but when i programmed the keypad the pad or fob buttons worked, but when iaim the theift system and walked away as soon asthe thief light went off the dash the alarm went off.so ireplaced the thieft box and it stilldoes it . what could i be doing wrong?