change serial function