I've figured it out now. I needed to read more than one line and I was using a usb powered hub so even when the raspberry pi was switched off, the dongle remained on and so it was never power cycled after I took the sim out earlier! Sorry for wasting time 🙂