hopefully fixed uart code