Fixed NPE during sync