fixing code, global and local contacts var (stupido)