Apple Wireless Keyboard (2003) not easily paring with iMac
So, I bought Apple Wireless Keyboard (the old model with mechanical keys) to use it with my iMac, Late 2013.
After pairing it with my mac, I found out that the keyboard was struggling to connect after boot up. After booting up the iMac, the keyboard seems to not wake up and just keeps disconnected with the iMac until I turn off the keyboard and turn it on again. Also, I don't know whether it's related to this but it struggles to send key strokes when booting up like sending "option" key to choose between bootcamp and mac partition even though I am pressing it right after the boot up sound. I have already tried out resetting PRAM and SMC and it still is not fixed. However the bluetooth keyboard (the aluminum one) that came with the iMac seems to be working fine. What can I do to fix this keyboard?
The model number for the keyboard is A1016
iMac, macOS Sierra (10.12.1)