tidied up script re wget check and tmp folder