added some verifications.