implemented function to add users to the database