fixed bug with dialog