fixed downloading to a directory rather than to current dir