Hello Sagar,
Thanks for the reply. You got it right. I had posted the same question on the Development Center forum and here is the link to reply from Richard for same question.
Just wanted to post it here as that reply as well provide the answer to question and with two different approaches.
Thanks! - AO.