ATT Galaxy Note 2 SGH-I317 charging issue after flashing custom rom

I installed TWRP 2.7 on my ATT galaxy note 2 SGH-I317 and flash with custom rom. Now I am having charging issues with my phone.

1. When my phone is off and charger is connected to the phone, phone does not charge. I can only see gray battery image with processing icon.

2. When my phone is on, my battery does not charge when connected to charger (Charge % stays the same or decreased even after hours of charging). I need to take out my battery and put back in before charging my phone (By doing this phone charges normally).

XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality.Are you a developer?