added curly braces to debug lines