fixed adding database for user (problem: incorrect type supplied to function is_object_valid)

fixed adding database for user (problem: incorrect type supplied to function is_object_valid)