fixed downloading in js to not open a new window