bind command changed in version 2.1, updated code