fix issue with debug mode not being passed correctly