added some checks..