Added failsafe conditions