added if clause to make sure there is a recording to store