added better errors and caller of bind