corrected random password functionality