added a bit of logging into index