added isinstance of unicode where was only str and added casting to unicode when  used widget method to set text