Add functional test