fix log and enable debug