added friend js logic