Fixed a MAJOR bug

this bug rendered connecting to client useless and in some cases DELETED
ALL MEDIA CONTENT.