encryption added and bug fixed