fixed tar issues, added error checking and tidied up