fixed printf debugging