replaced doc.ready with dom listener