I think I found the solution,,, well, atleast to my scenario.
1. Go to settings
2. Tap Battery
3. Tap Battery Usage
4.Tap ''More'' on top right corner
5. Select Optimize Battery Usage
6.Select All Apps from the drop down menu
7. Go to the app you are having issue with and then slide the button...