Updated JS handling for loading contacts