supress some debug message and improve lock for managed window