fix exception handle

save file to a new one when exceptino happens during recording