finally working serial writeing and reading code :D