added failsafe to js