adding checkin logic on backend