fixed crashes!