add apply and bid logic