Fixed wget function