add path info to error log and set timeout to 10 sec and fix cd.encoding == nil