fixed encryption bug