added option to pass the key