Fixed wrong cursor position. Added specific div for dialog.