calling sync twice on one click