moved error checking to more appropriate place for MP4