Put all actions into the sync subroutine