added some more safety