con to database is now set with function.