fixed bug with double writing media blocks