add support for passing in key