Working code no fail safe