Add log messages to find bug