So, I bought a play pen/crate for my four month old. She is fine in there as long as it is not closed. She will play/sleep in it but she goes in and out freely. The other day I closed it while she was in there and she flipped out. I decided to wait until she stopped barking to let her out. She barked 55mins non-stop

. I ended up just letting her out because we live in an apartment. How can I get her used to being closed in there? I really need help because she won't stay confined so potty training is becoming really hard.