Fixed mysql out of sync bug