How to know when serial has finished sending