fixes #168 - constructor returns undefined