media null exception fix