some debug logging before retutning 0