example consol error fix try catch