update logs and add try/catch