changed sample log level to debug (3)
added bock wise writing to db