added some safety