Changed to use dom id instead of dom element

Changed to use dom id instead of dom element