fix bug in bind func