Changed null check code
More work on download manager