getting download functionality to work