added lose condition