some improvement for Protocol. without protocol =illegal & close. Test added.