Added dialog box and changed when to start recording