Fixing issue with invalid types on sync function