Added a delay before disconnecting so write is more often succesful.