resolved null object reference in download method