fixed bug in recording functionality