corrected uri and added filename as returns value