Update javascript in bookmarklet to handle fail case