I hate myself

My front door is weird even if it's locked you can turn the knob on the inside and it'll open. So I went out to the balcony to give my husband a plate since he's grilling some things and I go back to the living room and hear the baby crying and I don't see him.. he opened the front door and was outside it crying because he couldn't get back in. I feel terrible I was only gone for 2 minutes but now I'm terrified. I just want to cry.. I feel like a terrible mom for taking my eyes off of him for a minute. I live in an apartment so at least he wasn't out in the street or anything but still... My mind is running places like what if he would of walked away, ran away and not stayed in the front of the door.. I hate myself so much I'll never take my eyes off of him how. Not even for a second. I will be putting up a gate outside the door right now. Sorry for the long post I just needed to say it since I have no one to speak to other than my husband