handle checkin and checkout