Added a password func;bugfixes