Final patch of mediahadler

Fixed #288 & #289. commits. This has been tested and works