Please read this topic to learn how to post code correctly and then apply it.

Thanks.