add friend graph and some bug fix