fixed bug considering the rootpanel