Added autorecord function