removed sys.exit(0) call in send function