fixed testing and encryption