fixed using constant instead of supplied function