fixed inf loop

need to work on bindings.