Capture js bug fix