code mofication to be compatible with arduino programming (auto reset)