fixed crashes