Erorr Checker script- needs tidying up but works fine