added some guards