added check for return code of auth script