fixed bug with salt generation