Fixed command

Fixed Race condition and null return from terminal