fix behavior of modal dialog