fix mistake in constant

Constant returns a function rather than an object