Adding debug output for stages check