Added makeMagetUri function.