Add null check and remove Progress dialog-related unncessary code