Hello first post. I have a Macbook pro(5,1 Early 2009) which i took apart sometime ago to replace the heatsink and may have messed with a few cables. But all in all it works, it's just that sometimes when i grab it to switch places it shuts off completeley and won't even charge for at least 5 minutes or so. This seems to happen a lot lately when i hold it sideways. But from time to time it happens when i just grab and lift it. Note: I have an aftermarket charger which i bought off amazon for 19, and my battery is close to death my os tells me to replace my battery immediately. I found temporary fix for it for after it happens so that i can get back power as fast as possible which is, after losing power i take out the battery for 10 seconds and plug it back in and remove the ac adapter from electricity outlet and remove electricity cord from adapter and hold the magsafe magnetic to the adapter electrical pins(in like think off it as to get rid off the bad electricty due to aftermarket charger) and plug everything back to its place and seems to fix it. But again its not a permanent solution i'd like to NOT have this problem at all. Many off you are going to say buy the original parts and replace battery, i'm also willing to do so but these parts are pretty expensive. And what i really like to know is, why does this happen? I'm ready to give further informartion as asked. But as of now I don't know what else I could add. Looking for help from the community.