Fixing media deletion bug