sync and read from db working