Fixed bug in encryption cmd logic