Updated app launching code