code for getting mmd on client side. usually works. will need to be refactored