added some more protection