use stream to manage dom events