corrected sync db, support for CORS