added some checks for things