fixed all crashes