Hi all,
Thank you for your advice. I have implemented the serial availiable code and that has helped.