function to replace %username% with current username