fix functionality