safety logic