added automatic upgrading