added js logic for contacts