added some log messages for debugging purpose