Thanks JonMcL. Updated code. you can see this diff at http://drupalcode.org/p...