Thanks a ton Marcel. I got it working. Its ugly code but its working.