fixed a bug in link callback