Default Power button and boot problems

Hello friends. I have a problem with my Samsung i9500 Galaxy S4. The thing is I can not use the button of power on or turn to lock the screen because the phone is turned off or rebooted and the Samsung logo appears, then it looks like is about to initialize but then reappears Samsung logo. The only way I can turn on the phone is by pressing the buttons of recovery mode and after about 3 attempts, the phone starts normally. I have the stock Rom 4.3 Jelly Bean. On the other hand this started since I took out the SD memory. I have reinstalled the ROM again and continued doing the same. No it may be. I think it is a problem in the boot but I can not solve it. I can not lock the screen with the power button because the phone turns off. I hope you can help me. regards