TH - made working functional tests