catch any javascript errors