fixed detect size for dialog