Added failsafe check