added losing conditions