Thanks for using healthcare magic
Penial erection depends upon the sexual thoughts. If you have repeatedly such kind of thoughts, in that case getting erection is normal. To control this thoughts you can do thoughts stoppage exercise or you can take low dose antidepressants after consultation with a psychiatrist
. That would help you to stay focus and control erection in off timing. Doing masturbation
is not harmful. Masturbation has no side effect, so nothing to worry about it.