add missing error handling in checkenv