added second level of composition and move the document click watch