Added rebinding functionality, fix modaldialog