Thanks Andreas and dojha00.

Thank you guys for taking your time to go through my code and pointing out the silly mistake that I have made.
Everything is working fine now. I guess what I needed was another set of eyes on it.

Regards
Kamil