Problem with serial communication

You write "I am not sure if i am using right functions on the right way. ". But how are we to know what you are referring to when a snippet of your code is all you post.

And please get rid of ALL the blank lines.

Paul