PC Controller stops working when disconnected

whenever my controller disconnects and reconnects it stops working altogether and i have to restart the game for it to work again, usually in the past when it would reconnect it would just stat working again.