Password check added

Functionality of password added to database functions