Middleware small inconistences fixed
A forgotton global variable was causing a lot of issues when trying to insert the recordings.