Database functions works well. Needs to be realized database structure.