added some cecks