!NEED HELP!My pc does not boot when completely shut off unless I switch placement of RAM

Oct 20, 2018
1
0
10
Pc specs:
Intel core i5 4670k
Gigabyte GA-Z87X-D3H
2x4gb Corsair Vengeance DDR3 1600
MSI R9 290 4G Gaming Edition
1TB HDD
850W PSU

I bought the cpu,ram,gpu and motherboard used from a guy and I was told that the mobo didn't work,so I bought a stock house cheap h81 motherboard and then I found out that a stick of ram was bricked and after only a few weeks the cheap motherboard started randomly freezing.I thought about testing the ''not working'' motherboard and maraculously the system worked fine until a few days later, the electricity went down in my house when the pc was turned on.After that,the pc would boot loop or the pc speaker would beep every 3 seconds or so,and after searching it online I took a ram stick out (yes,I replaced the bricked one) and the pc turned on.Just out of curiosity I placed the stick that I took and put it back in and the pc booted up! I thought I fixed the problem but ever since then every time I try to open the pc after I shut it off it will boot loop or the pc speaker will beep for 3 second or either the speaker will beep constantly.I have tried to use olny one stick of ram but the same thing keep happening.Plese helps me!!!!