fix bug for recording