Fix write_serial function for sending data trough serial port as string