Fixed download functionality