Adding support for bind attribute

Is this what the old code did? can we find a less hacky way to do it if that's not the case?