Update checker.pl

changes to logic and error handling