Fixed bug when runnning it from the terminal using subkey