changes to script and cleans stderr output clear