adding a failsafe timeout