Fixed execption error message. Moved logging for debug purpose.