Trying to figure out this damn sql command sync issue