Added a better support for serial communication