simplify customers.getCustomers().get(0).getHistory_id() to 

Customer customer = customers.getCustomers().get(0)
bind("history_id", customer.getHistory_id()