fixed bugs and added alert when not all files downloaded