Fix for JS error and syncing data