[working, but no idea why] MKRWAN library

I'm trying to connect to a OTAA LoRaWan network, and my code didn't work
After long time trying I figured it out: I had to call modem.version() andmodem.deviceEUI() otherwise it can't connect.
I don't do anything with these values (just print them).
But for some weird reason it doesn't work without these. I can't find any explanation why thee statements are needed.

My code works now, but can someone explain me why I need these lines?
I'm using library version 1.0.9