Structural phase transition on W and Mo surfaces