sets constant if not set and fixes #328