Thanks for pointing to the mistake.It works fine now.