Fix possible security issue in exchange script