Fixed segmenattion fault on first start