Changed mime/type to make IE8 happy
Made setting varaible object instead of undefined when first instansiated