add lock(sync) to database variable
Update chat message sending, need to fix alarmmanger thing and re login