logs and exception catching