add log and better error handle
fix bug