added some checks